package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.SysUserInvestor;
import com.ruoyi.system.mapper.SysUserInvestorMapper;
import com.ruoyi.system.service.ISysUserInvestorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 投资人信息Service业务层处理
 * 
 * @author paul
 * @date 2023-06-25
 */
@Service
public class SysUserInvestorServiceImpl implements ISysUserInvestorService
{
    @Resource
    private SysUserInvestorMapper sysUserInvestorMapper;

    /**
     * 查询投资人信息
     * 
     * @param id 投资人信息主键
     * @return 投资人信息
     */
    @Override
    public SysUserInvestor selectSysUserInvestorById(Long id)
    {
        return sysUserInvestorMapper.selectSysUserInvestorById(id);
    }

    /**
     * 查询投资人信息列表
     * 
     * @param sysUserInvestor 投资人信息
     * @return 投资人信息
     */
    @Override
    public List<SysUserInvestor> selectSysUserInvestorList(SysUserInvestor sysUserInvestor)
    {
        return sysUserInvestorMapper.selectSysUserInvestorList(sysUserInvestor);
    }

    /**
     * 新增投资人信息
     * 
     * @param sysUserInvestor 投资人信息
     * @return 结果
     */
    @Override
    public int insertSysUserInvestor(SysUserInvestor sysUserInvestor)
    {
        sysUserInvestor.setCreateTime(DateUtils.getNowDate());
        return sysUserInvestorMapper.insertSysUserInvestor(sysUserInvestor);
    }

    /**
     * 修改投资人信息
     * 
     * @param sysUserInvestor 投资人信息
     * @return 结果
     */
    @Override
    public int updateSysUserInvestor(SysUserInvestor sysUserInvestor)
    {
        sysUserInvestor.setUpdateTime(DateUtils.getNowDate());
        return sysUserInvestorMapper.updateSysUserInvestor(sysUserInvestor);
    }

    /**
     * 批量删除投资人信息
     * 
     * @param ids 需要删除的投资人信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserInvestorByIds(Long[] ids)
    {
        return sysUserInvestorMapper.deleteSysUserInvestorByIds(ids);
    }

    /**
     * 删除投资人信息信息
     * 
     * @param id 投资人信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserInvestorById(Long id)
    {
        return sysUserInvestorMapper.deleteSysUserInvestorById(id);
    }
}
